<?php


namespace App\Models\fund;


use App\Models\base\traits\HasOrder;
use App\Models\base\traits\HasOrderDetail;
use App\Models\base\traits\HasOwner;
use App\Models\base\traits\HasRelationUser;
use App\Models\Model;

/**
 * App\Models\fund\Rebate
 *
 * @property int $id
 * @property int $user_id 关联用户ID
 * @property int $relation_user_id 产生返点的用户ID
 * @property int $order_id 关联订单ID
 * @property int $type 1 下级购买商品返利    2 => 直邀购买会员返利  3 =>自己购买商品
 * @property float $amount 金额
 * @property string $title 说明
 * @property int $money_type 1收入  2支出
 * @property string|null $extend 扩展信息
 * @property int $status 状态  1=>已到账  0=>未到账
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User $RelationUser
 * @property-read \App\Models\goods\Order $order
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate owner($userId)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereAmount($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereExtend($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereMoneyType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereOrderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereRelationUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereUserId($value)
 * @mixin \Eloquent
 * @property int $lv 邀请层级  0=>非订单  1=>直邀  2=>间邀  3=>团队奖
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereLv($value)
 * @property int $order_detail_id 关联订单详情ID
 * @property-read \App\Models\goods\OrderDetail $order_detail
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\fund\Rebate whereOrderDetailId($value)
 */
class Rebate extends Model
{


    use HasOwner,HasRelationUser,HasOrder,HasOrderDetail;

    protected $fillable = [
        'user_id',
        'relation_user_id',
        'order_id',
        'type',
        'amount',
        'title',
        'status',
        'money_type',
        'lv',
        'order_detail_id'
    ];

}